home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / include / incl98.zoo / compiler.h < prev    next >
C/C++ Source or Header  |  1994-02-22  |  5KB  |  215 lines

  1. /* compiler specific defines */
  2. /* this file is guaranteed to be included exactly once if you include
  3.    anything at all. all site-dependent or compiler-dependent stuff
  4.    should go here!!!
  5.  */
  6.  
  7. #ifndef _COMPILER_H
  8. #define _COMPILER_H
  9.  
  10. /* symbols to identify the type of compiler */
  11.  
  12. #ifdef __SOZOBONC__
  13. #define __SOZOBON__ __SOZOBONC__
  14. #else
  15. # ifdef SOZOBON
  16.   /* The "real" Sozobon, as distinct from HSC.  Don't want to assume any
  17.      features about it, so set version number to 0. */
  18. # define __SOZOBON__ 0
  19. # endif
  20. #endif
  21.  
  22. #ifdef LATTICE
  23. #define __LATTICE__
  24. #endif
  25.  
  26. /* general library stuff */
  27. /* __SIZE_TYPEDEF__:     the type returned by sizeof() */
  28. /* __PTRDIFF_TYPEDEF__: the type of the difference of two pointers */
  29. /* __WCHAR_TYPEDEF__:     wide character type (i.e. type of L'x') */
  30. /* __EXITING:           the type of a function that exits */
  31. /* __NORETURN:          attribute of a function that exits (gcc >= 2.5) */
  32. /* __CDECL:             function must get parameters on stack */
  33.         /* if !__CDECL, passing in registers is OK */
  34.  
  35. /* symbols to report about compiler features */
  36. /* #define __NEED_VOID__    compiler doesn't have a void type */
  37. /* #define __MSHORT__        compiler uses 16 bit integers */
  38. /* (note that gcc and C68 define this automatically when appropriate) */
  39.  
  40. #ifdef __GNUC__
  41. #if __GNUC__ > 1
  42. #define __SIZE_TYPEDEF__ __SIZE_TYPE__
  43. #define __PTRDIFF_TYPEDEF__ __PTRDIFF_TYPE__
  44. #ifdef __GNUG__
  45. /* In C++, wchar_t is a distinct basic type,
  46.    and we can expect __wchar_t to be defined by cc1plus.  */
  47. #define __WCHAR_TYPEDEF__ __wchar_t
  48. #else
  49. /* In C, cpp tells us which type to make an alias for.  */
  50. #define __WCHAR_TYPEDEF__ __WCHAR_TYPE__
  51. #endif
  52. #else
  53. #ifndef sun
  54. #  define __SIZE_TYPEDEF__ unsigned long
  55. #  define __PTRDIFF_TYPEDEF__ long
  56. #  define __WCHAR_TYPEDEF__ int
  57. #else
  58.    /* sun always seems to have an agenda of their own */
  59. #  include <sys/stdtypes.h>
  60. #  define __SIZE_TYPEDEF__ int          /* can you believe this!! */
  61. #  define __PTRDIFF_TYPEDEF__ int       /* or this!! */
  62. #  define __WCHAR_TYPEDEF__ unsigned short /* this seems reasonable */
  63. #  define _SIZE_T __SIZE_TYPEDEF__
  64. #  define _WCHAR_T __WCHAR_TYPEDEF__
  65. #endif
  66. #endif
  67. #if __GNUC__ > 2 || __GNUC_MINOR__ >= 5 /* false for gcc < 2.5 */
  68. #define __NORETURN __attribute__ ((noreturn))
  69. #define __EXITING void
  70. #else
  71. #define __EXITING volatile void
  72. #endif
  73. #define __VA_LIST__ void *
  74. #ifndef __NO_INLINE__
  75. # define __GNUC_INLINE__
  76. #endif
  77. #endif
  78.  
  79. #ifdef __LATTICE__
  80. #define __SIZE_TYPEDEF__ unsigned long
  81. #define __PTRDIFF_TYPEDEF__ long
  82. #define __WCHAR_TYPEDEF__ char
  83. #define __EXITING void
  84. #define __CDECL __stdargs
  85. #ifdef _SHORTINT
  86. # define __MSHORT__
  87. #endif
  88. #ifdef _UNSIGNEDCHAR
  89. # define __CHAR_UNSIGNED__
  90. #endif
  91. #endif
  92.  
  93. #ifdef __C68__
  94. #define __SIZE_TYPEDEF__ unsigned long
  95. #define __PTRDIFF_TYPEDEF__ long
  96. #define __WCHAR_TYPEDEF__ char
  97. #define __EXITING void
  98. #endif
  99.  
  100. #ifdef __SOZOBON__
  101. /*
  102.  * Temporary hacks to overcome 1.33i's short symbol names.  As of 2.01i,
  103.  * this restriction is removed, but can be reinstated for compatibility
  104.  * via the -8 compiler flag.  -- sb 5/26/93
  105.  */
  106. #if __SOZOBON__ < 0x201 || !defined(__HSC_LONGNAMES__)
  107. #  define _mallocChunkSize _sc_mCS
  108. #  define _malloczero _sc_mz
  109. #  define _console_read_byte _sc_crb
  110. #  define _console_write_byte _sc_cwb
  111. #endif
  112.  
  113. #define __NULL (0L)
  114. #if __SOZOBON__ < 0x122        /* previous versions didn't grok (void *) */
  115. #  define void char
  116. #endif
  117. #define __SIZE_TYPEDEF__ unsigned int
  118. #define __PTRDIFF_TYPEDEF__ long
  119. #define __WCHAR_TYPEDEF__ char
  120. #define __EXITING void
  121. #if __SOZOBON__ < 0x201        /* 2.01 now #define's this */
  122. #  define __MSHORT__
  123. #endif
  124. #endif /* __SOZOBON__ */
  125.  
  126. #ifdef __TURBOC__
  127. #ifndef __STDC__
  128. #  define __STDC__ 1
  129. #endif
  130. #define __SIZE_TYPEDEF__ unsigned long
  131. #define __PTRDIFF_TYPEDEF__ long
  132. #define __WCHAR_TYPEDEF__ char
  133. #define __EXITING void
  134. #define __MSHORT__
  135. #define __VA_LIST__ void *
  136. #define __CDECL cdecl
  137. /* As long as we haven't ported gemlib to Pure C and hence have to use
  138.  * Turbo's/Pure's GEM library, define the next:
  139.  */
  140. #define __TCC_GEMLIB__
  141. #endif /* __TURBOC__ */
  142.  
  143. #if defined(__hpux) && (!defined(__GNUC__))
  144. #define __SIZE_TYPEDEF__ unsigned int
  145. #define __PTRDIFF_TYPEDEF__ int
  146. #define __WCHAR_TYPEDEF__ unsigned int
  147. #define __EXITING void
  148. #endif
  149.  
  150. /* some default declarations */
  151. /* if your compiler needs something
  152.  * different, define it above
  153.  */
  154. #ifndef __VA_LIST__
  155. #define __VA_LIST__ char *
  156. #endif
  157.  
  158. #ifndef __CDECL
  159. #define __CDECL
  160. #endif
  161.  
  162. #ifndef __NORETURN
  163. #define __NORETURN
  164. #endif
  165.  
  166. #ifndef __NULL
  167. #  ifdef __MSHORT__
  168. #    define __NULL ((void *)0)
  169. #  else
  170.      /* avoid complaints about misuse of NULL :-) */
  171. #    define __NULL (0)
  172. #  endif
  173. #endif
  174.  
  175. #ifdef __cplusplus
  176. # define __EXTERN
  177. # define __PROTO(x) x
  178. #else
  179. # ifdef __STDC__
  180. #  ifndef __NO_PROTO__
  181. #    define __PROTO(x) x
  182. #  endif
  183. #  define __EXTERN
  184. # else
  185. #  define __EXTERN extern
  186. /*
  187.  * fudge non-ANSI compilers to be like ANSI
  188.  */
  189. #  define const
  190. #  define volatile
  191.  
  192. #  ifdef __NEED_VOID__
  193. typedef char void;    /* so that (void *) is the same as (char *) */
  194.     /* also lets us know that foo() {...} and void foo() {...} are
  195.        different */
  196. #  endif
  197. # endif /* __STDC__ */
  198. #endif /* __cplusplus */
  199.  
  200. #ifndef __PROTO
  201. #define __PROTO(x) ()
  202. #endif
  203.  
  204. /* macros for POSIX support */
  205. #ifndef __hpux
  206. #define _UID_T unsigned short
  207. #define _GID_T unsigned short
  208. #define _PID_T int
  209. #endif
  210.  
  211. /* used in limits.h, stdio.h */
  212. #define    _NFILE        (32)        /* maximum number of open streams */
  213.  
  214. #endif /* _COMPILER_H */
  215.